import axios from "axios";


export const addCountAction=(inc)=>({
    type:"ADDCOUNT",
    payload:inc
})

export const addCountActionAsync=()=>{
    return (dispatch)=>{
        axios({
            url:"http://localhost:3000/inc"
        })
        .then(res=>{
            dispatch({
                type:"ADDCOUNT",
                payload:res.data.num
            })
        })
    }
}


export const addBookAction=(newBook)=>({
    type:"ADDBOOK",
    payload:newBook
})